home *** CD-ROM | disk | FTP | other *** search
- global knumphotos, knummaxalbumphotos, kdefaultphotoorder, knumcategory, kcategoryphotonums, kcategorythumbnailsprnumbgn, kphotothumbnailsprnumbgn, kthumbnailmarkersprnum, kalbumfullerrstr, kcategorythumbnailstrsprnum, kphotothumbnailstrsprnum, kphotothumbnailhoriznum, kmaxphotothumbnailnum, galbumphotoorder, gcurphotoorder, gcurcategorynum, gcurphotonum, gsavedalbummodephotonum, gcategorythumbnailonstage, gphotothumbnailonstage, galbummode, gcurmovienum, gsavedphotomodephotonum
-
- on showhidecategorythumbnail
- playclicksnd()
- busycurs()
- if gcategorythumbnailonstage then
- hidecategorythumbnail()
- else
- hidephotothumbnail()
- showcategorythumbnail()
- end if
- updateStage()
- resetcurs()
- end
-
- on showcategorythumbnail
- repeat with acategorycount = 1 to knumcategory
- set athumbnailsprnum to kcategorythumbnailsprnumbgn + acategorycount - 1
- sendSprite(athumbnailsprnum, #msetphotonum, getAt(getAt(kcategoryphotonums, acategorycount), 1))
- sendSprite(athumbnailsprnum, #mupdatethumbnailview)
- sendSprite(athumbnailsprnum, #mshowspr)
- end repeat
- set gcategorythumbnailonstage to 1
- updatecategorythumbnailmarker()
- sendSprite(kcategorythumbnailstrsprnum, #mshowspr)
- sendSprite(kcategorythumbnailstrsprnum, #mlockvisiblestate)
- end
-
- on hidecategorythumbnail
- repeat with acategorycount = 1 to knumcategory
- set athumbnailsprnum to kcategorythumbnailsprnumbgn + acategorycount - 1
- sendSprite(athumbnailsprnum, #mhidespr)
- end repeat
- sendSprite(kthumbnailmarkersprnum, #mhidemarker)
- set gcategorythumbnailonstage to 0
- sendSprite(kcategorythumbnailstrsprnum, #munlockvisiblestate)
- sendSprite(kcategorythumbnailstrsprnum, #mhidespr)
- end
-
- on updatecategorythumbnailmarker
- sendSprite(kthumbnailmarkersprnum, #msettargetsprnum, kcategorythumbnailsprnumbgn + gcurcategorynum - 1)
- if gcategorythumbnailonstage then
- sendSprite(kthumbnailmarkersprnum, #mshowmarker)
- end if
- end
-
- on getnumphotoincategory vcategorynum
- return count(getAt(kcategoryphotonums, vcategorynum))
- end
-
- on getphotocategorynum vphotonum
- set acategorynum to 0
- repeat with acategorycount = 1 to knumcategory
- set aphotolist to getAt(kcategoryphotonums, acategorycount)
- set apos to getPos(aphotolist, vphotonum)
- if apos <> 0 then
- set acategorynum to acategorycount
- exit repeat
- end if
- end repeat
- return acategorynum
- end
-
- on categorythumbnailclickreaction vsprnum
- playclicksnd()
- set aclickedthumbnailnum to vsprnum - kcategorythumbnailsprnumbgn + 1
- set gcurcategorynum to aclickedthumbnailnum
- setcurphotonum(getnumprevphoto() + 1)
- updatecategorythumbnailmarker()
- end
-
- on showhidephotothumbnail
- playclicksnd()
- busycurs()
- if gphotothumbnailonstage then
- hidephotothumbnail()
- updateStage()
- unloadphotothumbnail()
- else
- hidecategorythumbnail()
- showphotothumbnail()
- end if
- updateStage()
- resetcurs()
- end
-
- on unloadphotothumbnail
- set alastmembernum to the number of castMembers of castLib "thumb"
- unloadMember(member 1 of castLib "thumb", member alastmembernum of castLib "thumb")
- end
-
- on showphotothumbnail
- hidephotothumbnail()
- set anumphoto to getnumphotoincategory(gcurcategorynum)
- set athumbnailsprbgn to getphotothumbnailsprbgn()
- set aphotonumlist to getAt(kcategoryphotonums, gcurcategorynum)
- repeat with aphotocount = 1 to anumphoto
- set athumbnailsprnum to athumbnailsprbgn + aphotocount - 1
- sendSprite(athumbnailsprnum, #msetphotonum, getAt(aphotonumlist, aphotocount))
- sendSprite(athumbnailsprnum, #mupdatethumbnailview)
- sendSprite(athumbnailsprnum, #mshowspr)
- end repeat
- set gphotothumbnailonstage to 1
- updatephotothumbnailmarker()
- sendSprite(kphotothumbnailstrsprnum, #mshowspr)
- sendSprite(kphotothumbnailstrsprnum, #mlockvisiblestate)
- end
-
- on hidephotothumbnail
- repeat with aphotocount = 1 to kmaxphotothumbnailnum
- set athumbnailsprnum to kphotothumbnailsprnumbgn + aphotocount - 1
- sendSprite(athumbnailsprnum, #mhidespr)
- end repeat
- sendSprite(kthumbnailmarkersprnum, #mhidemarker)
- set gphotothumbnailonstage to 0
- sendSprite(kphotothumbnailstrsprnum, #munlockvisiblestate)
- sendSprite(kphotothumbnailstrsprnum, #mhidespr)
- end
-
- on updatephotothumbnailmarker
- set aphotonumlist to getAt(kcategoryphotonums, gcurcategorynum)
- set anumprevphoto to getnumprevphoto()
- set aphotopos to gcurphotonum - anumprevphoto
- sendSprite(kthumbnailmarkersprnum, #msettargetsprnum, getphotothumbnailsprbgn() + aphotopos - 1)
- if gphotothumbnailonstage then
- sendSprite(kthumbnailmarkersprnum, #mshowmarker)
- end if
- end
-
- on photothumbnailclickreaction vsprnum
- playclicksnd()
- set aclickedthumbnailnum to vsprnum - getphotothumbnailsprbgn() + 1
- set aclickedphotonum to getnumprevphoto() + aclickedthumbnailnum
- setcurphotonum(aclickedphotonum)
- updatephotothumbnailmarker()
- end
-
- on getphotothumbnailsprbgn
- set anumphoto to getnumphotoincategory(gcurcategorynum)
- set anumthumbnailline to anumphoto / kphotothumbnailhoriznum
- if (anumphoto mod kphotothumbnailhoriznum) <> 0 then
- set anumthumbnailline to anumthumbnailline + 1
- end if
- set amaxthumbnailline to kmaxphotothumbnailnum / kphotothumbnailhoriznum
- set aemptythumbnailline to amaxthumbnailline - anumthumbnailline
- set athumbnailsprbgn to kphotothumbnailsprnumbgn + (aemptythumbnailline * kphotothumbnailhoriznum)
- return athumbnailsprbgn
- end
-
- on getnumprevphoto
- set anumprevphoto to 0
- if gcurcategorynum > 1 then
- repeat with acategorycount = 1 to gcurcategorynum - 1
- set anumprevphoto to anumprevphoto + count(getAt(kcategoryphotonums, acategorycount))
- end repeat
- end if
- return anumprevphoto
- end
-
- on prevphotoclickreaction
- playclicksnd()
- decphotonum()
- updatethumbnailandmarker()
- end
-
- on nextphotoclickreaction
- playclicksnd()
- incphotonum()
- updatethumbnailandmarker()
- end
-
- on updatethumbnailandmarker
- set aphotocategorynum to getphotocategorynum(getAt(gcurphotoorder, gcurphotonum))
- if gcurcategorynum <> aphotocategorynum then
- set gcurcategorynum to aphotocategorynum
- if gphotothumbnailonstage then
- showphotothumbnail()
- else
- if gcategorythumbnailonstage then
- showcategorythumbnail()
- end if
- end if
- else
- if gphotothumbnailonstage then
- updatephotothumbnailmarker()
- else
- if gcategorythumbnailonstage then
- updatecategorythumbnailmarker()
- end if
- end if
- end if
- end
-
- on albummodeclickreaction
- playclicksnd()
- if isemptyalbum() then
- exit
- end if
- donephotomode()
- setautoslidestate(0)
- set galbummode to 1
- set gcurphotoorder to galbumphotoorder
- set gcurphotonum to gsavedalbummodephotonum
- go("album")
- updatephotoview()
- end
-
- on cameraclickreaction
- if count(galbumphotoorder) < knummaxalbumphotos then
- playsnd(#se, "shutter")
- repeat while sndbusy(#se)
- end repeat
- add(galbumphotoorder, getAt(kdefaultphotoorder, gcurphotonum))
- else
- alert(kalbumfullerrstr)
- end if
- end
-
- on donephotomode
- set gsavedphotomodephotonum to gcurphotonum
- set gcategorythumbnailonstage to 0
- set gphotothumbnailonstage to 0
- end
-
- on movielinkfromphotoclicked
- set amovielinknum to getmovielinknum(getAt(gcurphotoorder, gcurphotonum))
- if amovielinknum > 0 then
- playclicksnd()
- donephotomode()
- stopsnd(#bgm)
- go("movie")
- set gcurmovienum to amovielinknum
- updatemovieview()
- end if
- end
-
- on gomenufromphoto
- donephotomode()
- setautoslidestate(0)
- go("mainmenu")
- unLoad()
- end
-